package com.tuo51.foudation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2017/7/21
 * *******************************
 */
public class DeviceConstant {


    public enum ClientType{
        IOS_PAD(1, "T_IOS_PAD"),
        IOS_APP(2, "T_IOS_APP"),
        APK_PAD(3, "T_APK_PAD"),
        APK_APP(4, "T_APK_APP");

        @Setter
        private int code;

        @Setter
        private String value;

        ClientType(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public ClientType get(int code){
            for (ClientType status : values()) {
                if (status.codeOf()==code)
                    return status;
            }
            return null;
        }
    }
}
